import request from '@/utils/request'

export function getStoreByPage(data) {
  return request({
    url: '/store',
    params: { ...data }
  })
}

export function getStoreById(id) {
  return request({
    url: `/store/${id}`,
  })
}

export function addStore(data) {
  return request({
    url: '/store',
    method: 'post',
    data: data
  })
}

export function updateStoreById(data) {
  return request({
    url: `/store`,
    method: 'put',
    data: data
  })
}

export function deleteStore(id) {
  return request({
    url: `/store/${id}`,
    method: 'delete',
  })
}

export function batchDeleteStore(idList) {
  return request({
    url: `/store/batchDelete`,
    method: 'post',
    data: idList
  })
}

export function batchAddCategory(data) {
  return request({
    url: `/store/batchAddCategory`,
    method: 'post',
    data: data
  })
}

export function batchAddFruit(data) {
  return request({
    url: `/store/batchAddFruit`,
    method: 'post',
    data: data
  })
}

export function deleteMyCategoryById(id) {
  return request({
    url: `/store/deleteMyCategoryById/${id}`,
    method: 'delete'
  })
}

export function deleteMyFruitById(id) {
  return request({
    url: `/store/deleteMyFruitById/${id}`,
    method: 'delete'
  })
}
